<?php

use yii\db\Migration;

/**
 * Class m191230_032706_team
 */
class m191230_032706_team extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="团队成员表"';
        $this->createTable('{{%team}}', [
            'id' => $this->primaryKey(),
            'name' => $this->string()->notNull()->comment('名称'),
            'position' => $this->string()->notNull()->comment('职位'),
            'pic' => $this->string()->notNull()->comment('缩略图'),
            'intro' => $this->string()->notNull()->defaultValue('')->comment('简介'),
            'status' => $this->smallInteger()->notNull()->defaultValue(1)->comment('状态：为1正常，2为删除'),
            'sorts' => $this->integer()->defaultValue(50)->comment('排序'),
            'created_at' => $this->integer()->notNull(),
            'updated_at' => $this->integer()->notNull(),
            'deleted_at' => $this->integer(),
        ],$tableOptions);

    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        $this->dropTable('{{%team}}');

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m190912_055800_auth_rule cannot be reverted.\n";

        return false;
    }
    */
}
